package com.cdu.guoxinan.www.smartcom.mapper;

import com.cdu.guoxinan.www.smartcom.domian.pojo.HealthServiceAppointment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface HealthServiceAppointmentMapper {
    void insert(HealthServiceAppointment appointment);
    // 分页查询预约列表
    List<HealthServiceAppointment> selectPage(@Param("offset") int offset, @Param("limit") int limit);
    // 查询总数
    int countAll();
    // 按居民ID分页查询预约列表
    List<HealthServiceAppointment> selectPageByResidentId(@Param("residentId") Long residentId, @Param("serviceType") Integer serviceType, @Param("status") Integer status, @Param("appointmentDate") String appointmentDate, @Param("offset") int offset, @Param("limit") int limit);
    int countAllByResidentId(@Param("residentId") Long residentId, @Param("serviceType") Integer serviceType, @Param("status") Integer status, @Param("appointmentDate") String appointmentDate);
    // 新增：更新预约状态（取消预约）
    int updateStatus(@Param("appointmentId") Long appointmentId, @Param("status") Integer status);
    // 新增：删除预约
    int deleteById(@Param("appointmentId") Long appointmentId);
    // 新增：多条件分页查询所有预约
    List<HealthServiceAppointment> selectPageByCondition(@Param("serviceType") Integer serviceType, @Param("status") Integer status, @Param("appointmentDate") String appointmentDate, @Param("offset") int offset, @Param("limit") int limit);
    int countAllByCondition(@Param("serviceType") Integer serviceType, @Param("status") Integer status, @Param("appointmentDate") String appointmentDate);
} 